package com.buaa.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@SuppressWarnings("serial")
@Entity
@Table(name = "subject_field")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SubjectField implements Serializable {

	@Id
	@Column(name = "code", columnDefinition = "smallint(3) default -1")
	private Integer code;

	@Column(name = "name", columnDefinition = "varchar(20) default ''")
	private String name;

	public SubjectField() {
		super();
	}

	public SubjectField(Integer code, String name) {
		super();
		this.code = code;
		this.name = name;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "SubjectField [code=" + code + ", name=" + name + "]";
	}

}
